/*
** my_put_nbr.c for my_put_nbr in /home/chassa_m/rendu/Piscine-C-lib/my
** 
** Made by chassa_m
** Login   <chassa_m@epitech.net>
** 
** Started on  Tue Oct  8 12:59:54 2013 chassa_m
** Last update Thu Nov 28 11:27:53 2013 chassa_m
*/

int	my_put_nbr(unsigned int nb)
{
  int	neg;

  neg = 0;
  if (nb < 0)
    {
      my_putchar('-');
      if (nb == -2147483648)
	{
	  neg = 1;
	  nb = nb + 1;
	}
      nb = nb * -1;
    }
  if (nb >= 10)
    my_put_nbr(nb / 10);
  if (neg == 1)
    {
      neg = 0;
      my_putchar(nb % 10 + '1');
    }
  else
    my_putchar(nb % 10 + '0');
}
